﻿using Quartz;

namespace TasksManager
{
    [AttributeUsage(AttributeTargets.Class)]
    public class JobAttribute : Attribute
    {
        /// <summary>
        /// job名称
        /// </summary>
        public string JobName { get; set; }

        public string TriggerName { get; set; }
        /// <summary>
        /// Job分组
        /// </summary>
        public string GroupName { get; set; }

        /// <summary>
        /// 时间，默认是在配置文件中配置，也可以手动
        /// </summary>
        public string Cron { get; set; }

        /// <summary>
        /// 是否立刻开始,默认是true
        /// </summary>
        public bool IsStartNow { get; set; }

        public JobAttribute(string jobName, string triggerName, string groupName = "",
        string cron = "", bool isStartNow = true)
        {
            this.JobName = jobName;
            this.TriggerName = triggerName;
            this.GroupName = groupName;
            this.Cron = cron;
            this.IsStartNow = isStartNow;
        }
    }

}
